#pragma once

#include "Singleton.h"
#ifdef _GEOMUIDLL
#define GEOMAPPAPI  _declspec(dllexport)
#else
#define GEOMAPPAPI  _declspec(dllimport)
#endif

class CPlugManager;
class IPropScript;
class CPropWrapper;
class CGeomDocTree;

class GEOMAPPAPI CGeomApp
	: public ATools::TSingleton<CGeomApp>
{
public:
	CGeomApp(void);
	~CGeomApp(void);
	BOOL Initialize();
	bool LoadEditorProps(const char* szScript, 
		CPropWrapper* pPropWrapper);
	void SetPropScript(IPropScript* pScript);
	
	void SetDocTree(CGeomDocTree* pObTree){m_pObjectTree = pObTree;}
	CGeomDocTree* GetDocTree(void){return m_pObjectTree;}

protected:
	CPlugManager*	m_pPlugs;
	IPropScript*	m_pScript;
	CGeomDocTree*	m_pObjectTree;
};


//////////////////////////////////////////////////////////////////////////

inline GEOMAPPAPI CGeomApp& GetGeomApp(void)
{
	return CGeomApp::Instance();
}
class CView;

GEOMAPPAPI CView* GetActiveView();
GEOMAPPAPI void SendMessageToActiveView(UINT nMsg, WPARAM wp, LPARAM lp);